package com.course.web.view;

import com.course.web.component.custom.SpecInfoGrid;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.ui.CustomComponent;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Justin on 2017/5/12.
 */
@SpringView(name = SpecListView.NAME)
public class SpecListView extends CustomComponent implements View {
    public static final String NAME = "spec-list";

    private final SpecInfoGrid specInfoGrid;

    @Autowired
    public SpecListView(SpecInfoGrid specInfoGrid) {
        this.specInfoGrid = specInfoGrid;
        setCompositionRoot(specInfoGrid);
        setSizeFull();
    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
        specInfoGrid.enter();
    }
}
